package Day07数组;

//两个变量指向同一个数组
//int[] arr2 = arr1; //没有new 不是创建新数组,=是赋值运算,是将arr1的地址[I@1540e19d  赋值给arr2

public class ShuZu02 {
    public static void main(String[] args) {
        int[] arr1 = new int[2];

        System.out.println(arr1); //[I@1540e19d
        System.out.println(arr1[0]);//0
        System.out.println(arr1[1]);//0
    //重点    *******
        int[] arr2 = arr1; //没有new 不是创建新数组,是将arr1的地址[I@1540e19d 赋值给arr2

        System.out.println(arr2); //[I@1540e19d 存放地址一样

        arr2[1] = 666;

        System.out.println(arr1[1]);//666
        System.out.println(arr2[1]);//666
    }
}
